﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;

namespace Gueei.Gallery.Core.Filters
{
	public abstract class ImageFilter
	{
		public abstract Image ApplyFilter(Image original);
		public static Image CreateBitmapImageFromByteArray(byte[] data)
		{
			using(var ms = new MemoryStream(data))
			{
				return Image.FromStream(ms);
			}
		}

		public static byte[] CreateByteArrayFromBitmapImage(Image original)
		{
			var ms = new MemoryStream();
			original.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
			return ms.ToArray();
		}
	}
}
